package com.hhf.rpc.core.registry;

import com.hhf.rpc.core.registry.impl.EtcdRedistry;
import com.hhf.rpc.core.spi.SpiLoader;

/**
 * @Author hhf
 * @Date 2024/10/17
 * @Description
 */
public class RegistryFactory {

    /**
     * 默认注册中心
     */
    private static final Registry DEFAULT_REGISTRY = new EtcdRedistry();

    /**
     * 获取实例(懒加载)
     * @param serviceKey
     * @return
     */
    public static Registry getRegistry(String serviceKey){
        return SpiLoader.getInstance(Registry.class,serviceKey);
    }
}
